<?php

class authorsActions extends sfActions {

    public function executeIndex(sfWebRequest $request){
        //
    }

    public function executeShow(sfWebRequest $request){
        $id = $request->getParameter('id');
        $author = AccountPeer::retrieveByPK($id);
        if(is_object($author)){
            $this->author = $author;
        }else{
            $this->setTemplate('notFound');
        }
        $this->array_suattr = $this->getUser()->getAttribute('suattr');

        $c = new Criteria();
        $c->add(ArticlePeer::OWNER_ID, $id);
        $c->add(ArticlePeer::ENABLED, 1);
        $c->add(ArticlePeer::IS_DRAFT, 0);
        $this->articles = ArticlePeer::doSelect($c);

        /*crear metodo que reciba ids y devuelva arreglo de usuarios practil */
        $ids = array();
        $ids[] = $author->getPractilAccountId();

        $myLib = new myLib();
        $array_users = array();
        $array_users = $myLib->getUsersFromPractil($ids);

        $this->array_users = $array_users;
    }

}